package com.beiing.tianshuai.tianshuai.message.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.MyGroupsBean;
import com.beiing.tianshuai.tianshuai.message.model.MyGroupsModel;
import com.beiing.tianshuai.tianshuai.message.model.MyGroupsModelImpl;
import com.beiing.tianshuai.tianshuai.message.view.MyGroupsViewImpl;

/**
 * Created by Jinni on 2017/9/20 0020.
 */

public class MyGroupsPresenter extends BasePresenter implements MyGroupsPresenterImpl, MyGroupsModel.OnRequestListener {

    private MyGroupsViewImpl        mView;
    private MyGroupsModelImpl       mModel;

    public MyGroupsPresenter(MyGroupsViewImpl view) {
        mView = view;
        mModel = new MyGroupsModel(this);
    }

    @Override
    public void getMyGroupsRequestResponse(String uid) {
        mView.showProgress();
        mModel.getMyGroupsRequestResponse(uid);
    }

    @Override
    public void onSuccess(MyGroupsBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
